package com.lnking.lnkingplace.controller;


import com.lnking.common.http.ReturnResult;
import com.lnking.lnkingplace.model.request.historyDateConfig.HistoryDateConfigUpdateRequest;
import com.lnking.lnkingplace.service.IHistoryDateConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhangqt
 * @since 2022-10-09
 */
@RestController
@RequestMapping("/history-date-config")
@Api(tags = "历史数据时间配置")
public class HistoryDateConfigController {

    @Resource
    IHistoryDateConfigService historyDateConfigService;

    @GetMapping("queryData")
    @ApiOperation("查询")
    public ReturnResult queryData(){
        return ReturnResult.success(historyDateConfigService.getBaseMapper().selectOne(null));
    }

    @PostMapping("update")
    @ApiOperation("修改")
    public ReturnResult update(@RequestBody HistoryDateConfigUpdateRequest params){
        historyDateConfigService.update(params);
        return ReturnResult.success();
    }
}
